<?php
define('APPLICATION_PATH', dirname(dirname(__FILE__)));
require APPLICATION_PATH.'/../library/Simpple/Application.php';
$app = Simpple_Application::getInstance();

$app->initCharset();
$app->initTimezone();

$app->addIncludePath(APPLICATION_PATH.'/../library/');
$app->autoLoad();
$app->initLogger(APPLICATION_PATH.'/app/data/logs/');

$dispatcher = Simpple_Dispatcher::getInstance();
$router = new Simpple_Controller_Router();
//$router->addRule(array(
//	'rule' 		=> '{action}',
//	'router'	=> array(
//		'controller'	=> 'user',
//	),
//	'keys' => array(
//		'action' => '(login|logout|register)',
//	),
//));
//$router->addRule(array(
//	'rule' 		=> '{site}/{controller}/{action}',
//	'keys'		=> array(
//		'site'	=> 'bj|sh|gz',
//	),
//));
//
//$router->addRule(array(
//	'rule' 		=> '{site}/?',
//	'keys'		=> array(
//		'site'	=> 'bj|sh|gz',
//	),
//));
$dispatcher->initRouter($router);
$dispatcher->setErrorController('user');;

$app->dispatch(APPLICATION_PATH,$dispatcher);
?>